package com.morgan.recyclerviewdemo.utils

import android.view.View

/**
 *description：
 *<br>author：caowugao
 *<br>time：2020/8/30 0030 09:41
 */

fun View?.setVisible(visible : Boolean) {
    if (this == null) {
        return
    }
    if (visible) {
        if (this.visibility != View.VISIBLE) {
            this.visibility = View.VISIBLE
        }
        return
    }

    if (this.visibility == View.VISIBLE) {
        this.visibility = View.GONE
    }
}

fun View?.setVisible(visible : Int) {
    if (this == null) {
        return
    }
    if (visibility != visible) {
        visibility = visible
    }
}
